import { fromJS } from 'immutable'
import {
  COOKBOOKTYPE_ADD_SWIPER,
  COOKBOOKTYPE_ADD_HOTCATE,
  COOKBOOKTYPE_ADD_GOODFOOD
} from '../types/cookbookType'

export default {
  // state是一个immutable对象  data是一个js对象
  [COOKBOOKTYPE_ADD_SWIPER](state, data) {
    return state.set('swiper', fromJS(data))
  },
  [COOKBOOKTYPE_ADD_HOTCATE](state, data) {
    return state.set('hotcate', fromJS(data))
  },
  [COOKBOOKTYPE_ADD_GOODFOOD](state, data) {
    return state.set('goodfood', fromJS(data))
  }
}